use chrono::NaiveDateTime;

#[derive(Debug, Queryable)]
#[diesel(table_name = crate::schema::roles)]
pub struct Role {
  pub id: i32,
  pub code: String,
  pub name: String,
  pub created_at: NaiveDateTime,
}

#[derive(Insertable)]
#[diesel(table_name = crate::schema::roles)]
pub struct NewRole {
  pub code: String,
  pub name: String,
}

#[derive(Queryable)]
#[diesel(table_name = crate::schema::roles)]
pub struct UpdateRole {
  // #[serde(skip_deserializing)]
  // pub id: i32,
  pub code: String,
  pub name: String,
  // #[serde(skip_deserializing)]
  // pub created_at: NaiveDateTime,
}
